import { Fragment } from "react";
import { notFound } from 'next/navigation';

export default async ({ params }: { params: { id: string } }) => {
  // console.log('🐒 ~ params.id: ', params.id)

  if (params.id !== "999" && !['1', '2','3'].includes(params.id)) {
    // 如果 ID 不合法，返回 404
    return notFound();
  }
  await new Promise<void>((resolve) => {
    setTimeout(() => {
      resolve();
    }, 2000);
  });

  return (
    <Fragment>
      <p>id:{params.id}</p>
    </Fragment>
  );
};
